# coding = utf-8
import requests
from bs4 import BeautifulSoup

def getHTMLText(url,coding='utf-8'):
    try:
       r = requests.get(url)
       r.raise_for_status()
       r.encoding = coding
       return r.text
    except:
       return ""


def getInfo(text, url):
    soup = BeautifulSoup(text, 'html.parser')
    pre = soup.find('pre')
    with open(url, 'w') as f:
        f.write(pre.string)
    pass
 

    

def main():
    html = getHTMLText("https://www.python.org/dev/peps/pep-0020/")
    getInfo(html, 'zon_of_python.txt')

main()
